import torch
from torch_geometric.data import Data
from torch_geometric.datasets import Planetoid
from torch_geometric.utils import remove_isolated_nodes

permitted_data = ['cora', 'citeseer', 'pubmed', 'facebook', 'webkb']
num_nodes_dict = {'cora': 2708, 'citeseer': 3327, 'facebook': 6637, 'pubmed': 19717, 'webkb': 877}

train = torch.load('../data/LP/cora/cora_train_ei_0.5.pt')
test = torch.load('../data/LP/cora/cora_test_ei_0.5.pt')
label = torch.load('../data/LP/cora/cora_test_label_0.5.pt')

print(torch.sum(label))
print(label)


dataset = Planetoid(root='../data/NC/', name='cora')
data = dataset[0]
#
print(data)
# print(data.y.shape)
# print(data.edge_index.shape)
# print(torch.max(data.edge_index))
# print(torch.min(data.edge_index))
#
# graph = {}
# nodes = set()
#
# edge_index = torch.transpose(data.edge_index, 0, 1).numpy()
#
# for edge in edge_index:
#     nodes.add(edge[0])
#     nodes.add(edge[1])
#     if graph.get(edge[0]) is None:
#         graph[edge[0]] = []
#     if graph.get(edge[1]) is None:
#         graph[edge[1]] = []
#     graph[edge[0]].append(edge[1])
#     graph[edge[1]].append(edge[0])
#
# print('nums of nodes ' + str(len(data.x)))
# print('connected nodes ' + str(len(nodes)))
# print(torch.max(data.edge_index))
# print(torch.min(data.edge_index))
#
# print(len(graph.keys()))
#
# for i in range(len(data.x)):
#     if graph.get(i) is None:
#         graph[i] = []
# print(len(graph.keys()))